package com.beerandjesus.sportofkings.handicapper.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "horse", schema = "handicapper")
public class BaseHorseImpl implements BaseHorse {

    @Id
    private Long id;

    @Column(name = "name")
    private String name;

    @Column(name = "birth_year")
    private String birthYear;

    @Column(name = "foaling_month")
    private String foalingMonth;

    @Column(name = "sire_name")
    private String sireName;

    @Column(name = "dam_sire_name")
    private String damSireName;

    @Column(name = "auction_price")
    private String auctionPrice;

    @Column(name = "sex")
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthYear() {
        return birthYear;
    }

    public void setBirthYear(String birthYear) {
        this.birthYear = birthYear;
    }

    public String getFoalingMonth() {
        return foalingMonth;
    }

    public void setFoalingMonth(String foalingMonth) {
        this.foalingMonth = foalingMonth;
    }

    public String getSireName() {
        return sireName;
    }

    public void setSireName(String sireName) {
        this.sireName = sireName;
    }

    public String getDamSireName() {
        return damSireName;
    }

    public void setDamSireName(String damSireName) {
        this.damSireName = damSireName;
    }

    public String getAuctionPrice() {
        return auctionPrice;
    }

    public void setAuctionPrice(String auctionPrice) {
        this.auctionPrice = auctionPrice;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BaseHorseImpl)) return false;

        BaseHorseImpl baseHorse = (BaseHorseImpl) o;

        if (auctionPrice != null ? !auctionPrice.equals(baseHorse.auctionPrice) : baseHorse.auctionPrice != null)
            return false;
        if (birthYear != null ? !birthYear.equals(baseHorse.birthYear) : baseHorse.birthYear != null) return false;
        if (damSireName != null ? !damSireName.equals(baseHorse.damSireName) : baseHorse.damSireName != null)
            return false;
        if (foalingMonth != null ? !foalingMonth.equals(baseHorse.foalingMonth) : baseHorse.foalingMonth != null)
            return false;
        if (id != null ? !id.equals(baseHorse.id) : baseHorse.id != null) return false;
        if (name != null ? !name.equals(baseHorse.name) : baseHorse.name != null) return false;
        if (sex != null ? !sex.equals(baseHorse.sex) : baseHorse.sex != null) return false;
        if (sireName != null ? !sireName.equals(baseHorse.sireName) : baseHorse.sireName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (birthYear != null ? birthYear.hashCode() : 0);
        result = 31 * result + (foalingMonth != null ? foalingMonth.hashCode() : 0);
        result = 31 * result + (sireName != null ? sireName.hashCode() : 0);
        result = 31 * result + (damSireName != null ? damSireName.hashCode() : 0);
        result = 31 * result + (auctionPrice != null ? auctionPrice.hashCode() : 0);
        result = 31 * result + (sex != null ? sex.hashCode() : 0);
        return result;
    }
}
